<%@ page language="java" import="java.util.*" pageEncoding="UTF-8" %>
<%@page import="com.tss.util.*"%>
<%@page import="com.jedi.*"%>
<%@page import="com.store.*"%>
<%@page import="java.util.*"%>
<%@page import="java.text.*"%>
<%@page import ="java.sql.*"%>
<%@include file="../global_var.jsp"%>
<%@include file="../check_login.jsp"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
String enddate = new SimpleDateFormat("yyyy-MM-dd").format(Calendar.getInstance().getTime());
Calendar calen = Calendar.getInstance();
calen.setTime(TSSDate.parseDate(enddate));
calen.add(Calendar.MONTH, -1);
String begindate = new SimpleDateFormat("yyyy-MM-dd").format(calen.getTime());
String begin_date = ParamUtils.getParameter(request, "begin_date",begindate);//开始时间
String end_date = ParamUtils.getParameter(request, "end_date",enddate);//结束时间
UserMgr userMgr = new UserMgr();
User just_user = (User)session.getAttribute("LoginUser");
String power_enable_id = "10202";
if (!just_user.hasPower(power_enable_id)) {
	out.println(strNoPowerInfo); 
	return;
}
String area_id       = ParamUtils.getParameter(request,"area_id","");
String engineerid       = ParamUtils.getParameter(request,"engineerid","");

%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <base href="<%=basePath%>">
    
    <title>My JSP 'task_search.jsp' starting page</title>
    
    <meta http-equiv="pragma" content="no-cache">
    <meta http-equiv="cache-control" content="no-cache">
    <meta http-equiv="expires" content="0">
    <meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
    <meta http-equiv="description" content="This is my page">
    <link href="style/main.css" rel="stylesheet" type="text/css">
<script language="javascript" src="js/common.js"></script>
<script language="javascript">
function chk_submit() {
	var oForm = document.operatorForm;
	oForm.action = "task_mgt/task_search_result.jsp";
	return true;
}
function chk_submit() {
	var oForm = document.operatorForm;
	oForm.action = "task_mgt/task_list.jsp";
	return true;
}
</script>
</head>
<body  leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">
<table width="100%" border="0" cellpadding="0" cellspacing="0">
  <tr>
    <td >
      <table width="100%" border="0" cellspacing="0" cellpadding="0">
       
        <tr> 
          <td height="100" align="center" valign="top" style="padding-top:20px;padding-bottom:10px;">
          <form name="operatorForm" method="post" onsubmit="return chk_submit();">
            <table width="80%" border="0" cellpadding="3" cellspacing="1" bgcolor="#FFFFFF">
              
                <tr> 
                <td width="30%" height="24" align="right" bgcolor="#858585"><font color="#FFFFFF">区域：</font></td>
                <td bgcolor="#EDEDF0">
                   <select name="area_id">
                   <option value="">全部</option>
                    <%for(int i=0;i<area_item_info.length;i++){%>
                    <option value="<%=area_item_info[i]%>"<%if (area_id.trim().equals(area_item_info[i])){%> selected<%}%>><%=area_item_info[i]%></option>
                    <%}%>
                   </td>
              </tr>
               <tr>
                <td height="24" align="right" bgcolor="#858585">
                  <font
                  color="#FFFFFF">工程师姓名：</font>
                </td>
                <td bgcolor="#EDEDF0">
                 <select name="engineerid" >
            	        <option value="">全部</option>
            	        <%
            	    	String engineer="engineer";
            	        List userList = userMgr.getUsersGroupbyroleid(engineer);
            	        if (userList != null && userList.size() > 0) {
                    		for(int i=0;i<userList.size();i++){
                    			User item = (User)userList.get(i);
                    	%>
                        <option value="<%=item.getId()%>"<%if (item.getId().equals(engineerid)) {%> selected<%}%>><%=item.getUserName()%></option>
                    	<%}}%>
            	      </select>
                </td>
              </tr>
             
             <tr>
						<td height="24" align="right" bgcolor="#858585"><font
							color="#FFFFFF">时间类型：</font></td>
						<td bgcolor="#EDEDF0">
						  <input type="radio" name="time_type" value="0" checked> 按开始时间 &nbsp;&nbsp;
						  <input type="radio" name="time_type" value="1"> 按结束时间
						</td>
					</tr>
             <tr>
                 <td height="24" align="right" bgcolor="#858585"><font
                  color="#FFFFFF">登记日期：</font></td>
                <td bgcolor="#EDEDF0" class="black">
                  从 <span id="htmlBeginTime">&nbsp;</span> &nbsp; 至 &nbsp; <span id="htmlEndTime" >&nbsp;</span>
                </td>
              </tr>
             
           
              <tr> 
                <td height="24" align="right" bgcolor="#EDEDF0">&nbsp;</td>
                <td bgcolor="#EDEDF0"> 
                  <input type="submit" name="submit" value="搜 索" class="inputButton"> 
                  <input type="reset" name="reset" value="重 写" class="inputButton"> 
                  <input type="hidden" name="cmd" value=""> 
                </td>
              </tr>
           
            </table>
               </form>
          </td>
        </tr>
      </table>
    </td>
  </tr>
</table>
	<script language="javascript">
	htmlBeginTime.innerHTML = showCalenderInput("begin_date","operatorForm","<%=begin_date%>",1);
	htmlEndTime.innerHTML = showCalenderInput("end_date","operatorForm","<%=end_date%>",1);
</script>
</body>
</html>